Spring Boot/SPRING BOOT MCQ QUESTIONS Sample Test,Sample questions

Question:
 What is Spring Initializer?

1.Web-based tool to bootstrap Spring projects and generate project skeletons with the necessary configurations and dependencies.

2.A command-line tool for generating a basic Spring Boot project structure

3.A tool for initializing a Spring-based application with a specific set of dependencies

4.A tool for creating a Spring Boot application with a specific set of features

Posted Date:-2024-01-29 14:54:10


Question:
 Which Spring annotation is used to handle HTTP POST requests?

1.@GetMapping

2.@PutMapping

3.@CreateMapping

4.@PostMapping

Posted Date:-2024-01-29 15:01:09


Question:
@RestController annotation is a combination of the below two annotations

1.@Component and @ResponseBody annotations

2.@Controller and @ResponseBody annotations

3.@Service and @ResponseBody annotations

4.None of the above

Posted Date:-2024-01-29 14:56:20


Question:
Different ways to configure Spring-based applications?

1.XML based configuration

2.Java-based configuration

3.Annotation based configuration

4.All of the above

Posted Date:-2024-01-29 15:57:38


Question:
Different ways to inject Spring beans in Spring-based applications?

1.Constructor based

2.Setter based

3.Field-based

4.All of the above

Posted Date:-2024-01-29 16:03:47


Question:
How can a Spring Boot application be packaged and distributed? 

1.As a JAR file

2.As a WAR file

3.As a ZIP file

4.All of the above

Posted Date:-2024-01-29 14:55:16


Question:
How can you specify the port on which a Spring Boot application runs? 

1.By modifying the application.properties file

2.By modifying the application.yml file

3.By using the --server.port command-line option

4.All of the above

Posted Date:-2024-01-29 15:51:06


Question:
In Spring MVC web applications, all the HTTP requests first come to which component?

1.DispatcherServlet

2.Controller

3.HandlerMapper

4.None of the above

Posted Date:-2024-01-29 16:01:38


Question:
In spring MVC, DispatcherServlet consults ____________ to map the logical view name with the actual view implementation

1.ViewResolver

2.Handler Mapper

3.Controller

4.Model

Posted Date:-2024-01-29 16:01:07


Question:
JdbcTemplate implements the below design pattern?

1.Strategy design pattern

2.Template Design pattern

3.Singleton design pattern

4.Decorator design pattern

Posted Date:-2024-01-29 16:03:15


Question:
Minimum Java version used for Spring Boot 3?

1.Java 8

2.Java 11

3.Java 17

4.Java 10

Posted Date:-2024-01-29 15:55:20


Question:
Spring Boot is used for developing?

1.Web applications

2.Distributed applications (Restful web services)

3.Microservices

4.All of the above

Posted Date:-2024-01-29 14:53:34


Question:
Spring MVC Framework is designed based on which Design Pattern?

1.Model-View-Controller (MVC)

2.Layered pattern

3.Client-server pattern

4.None of the above

Posted Date:-2024-01-29 16:00:46


Question:
What are Spring stereotype annotations?

1.@Service

2.@Controller

3.@Repository

4.All of the above

Posted Date:-2024-01-29 15:58:54


Question:
What are the Spring annotations used for Exception handling?

1.@ControllerAdvice

2.@ExceptionHandler

3.@ResponseStatus

4.All of the above

Posted Date:-2024-01-29 15:54:53


Question:
What are two ways to achieve dependency Injection in Spring?

1.Using Getter and Setter methods

2.Using Setter and Constructor

3.Using Getter and Constructor

4.Using Setter and Factory methods

Posted Date:-2024-01-29 15:59:22


Question:
What does Spring Boot do to simplify the configuration of a Spring-based application?

1.Automatically configures necessary beans and dependencies

2.Uses annotations to configure beans and dependencies

3.Allows for the use of XML configuration files

4.Provides a command line interface for configuring the application

Posted Date:-2024-01-29 14:54:43


Question:
What is the @SpringBootApplication annotation used for? 

1.To enable Spring Boot auto-configuration

2.To define a Spring Boot starter class

3.To define a Spring Boot controller

4.To define a Spring Boot service

Posted Date:-2024-01-29 15:52:59


Question:
What is the default Logging implementation offered by Spring Boot?

1.By using Log4j

2.By using Logback

3.By using SLF4J

4.By using JUL (Java Util Logging)

Posted Date:-2024-01-29 15:52:34


Question:
What is the default scope of the Spring Bean?

1.singleton

2.prototype

3.request

4.session

Posted Date:-2024-01-29 15:57:16


Question:
What is the difference between PUT and PATCH in REST API? 

1.PUT completely update an existing resource, while PATCH modifies only the fields specified in the request body

2.PUT is used to update the resource, while PATCH is used to create a resource

3.PUT is used to retrieve data, while PATCH is used to update data

4.PUT is used to delete the resource, while PATCH is used to update the resource

Posted Date:-2024-01-29 15:55:43


Question:
What is the difference between Spring and Spring Boot? 

1.Spring is a Java framework, while Spring Boot is a Java library

2.Spring Boot is an opinionated version of Spring, providing a set of default configurations

3.Spring Boot is a lightweight version of Spring, while Spring is a full-featured framework

4.Spring Boot is a front-end framework, while Spring is a back-end framework

Posted Date:-2024-01-29 15:52:07


Question:
What is the main purpose of the Spring Framework? 

1.To provide a comprehensive programming and configuration model for Java-based enterprise applications

2.To provide a comprehensive programming and configuration model for JavaScript-based web applications

3.To provide a comprehensive programming and configuration model for PHP-based web applications

4.To provide a comprehensive programming and configuration model for Python-based web applications

Posted Date:-2024-01-29 15:56:45


Question:
What is the primary use of the Spring Security module? 

1.To provide authentication and authorization for web applications

2.To provide data access and management

3.To provide Model-View-Controller architecture

4.To provide aspect-oriented programming functionality

Posted Date:-2024-01-29 16:06:24


Question:
What is the purpose of the Spring Boot Actuator? 

1.To provide production-ready features such as monitoring and metrics

2.To provide a way to configure beans using annotations

3.To provide a way to run Spring Boot applications as a service

4.To provide a way to access the underlying database of a Spring Boot application

Posted Date:-2024-01-29 15:50:31


Question:
What is the purpose of the Spring Boot DevTools? 

1.To provide a way to run Spring Boot applications in a development environment

2.To provide hot-reloading of code changes and automatic application restart

3.To provide a way to run Spring Boot applications as a service

4.To provide a way to access the underlying database of a Spring Boot application

Posted Date:-2024-01-29 15:51:38


Question:
What is the purpose of the Spring IoC container? 

1.To manage the lifecycle of beans and their dependencies

2.To handle the configuration of the application

3.To provide a caching mechanism for the application

4.To provide a security mechanism for the application

Posted Date:-2024-01-29 15:58:03


Question:
What is the purpose of the Spring JDBC module? 

1.To provide a data access framework for accessing databases

2.To provide a web framework for building web applications

3.To provide aspect-oriented programming functionality

4.To provide caching functionality

Posted Date:-2024-01-29 16:02:27


Question:
What is the purpose of the Spring MVC module? 

1.To provide a web framework for building web applications

2.To provide a data access framework for accessing databases

3.To provide a caching framework for caching data

4.To provide a security framework for securing web applications

Posted Date:-2024-01-29 15:58:26


Question:
What is the scope to create a new instance every time the bean is requested from the spring container?

1.singleton

2.prototype

3.request

4.session

Posted Date:-2024-01-29 15:59:46


Question:
Which annotation do we use to mark the class as a Service class/component?

1.@Component

2.@Service

3.@Controller

4.@Repository

Posted Date:-2024-01-29 15:02:58


Question:
Which annotation is used to unit test Spring MVC Controllers?

1.@SpringBootTest annotation

2.@WebMvcTest annotation

3.@DataJpaTest annotation

4.None of the above

Posted Date:-2024-01-29 15:53:53


Question:
Which annotation Spring Boot provides for Integration testing?

1.@SpringBootTest annotation

2.@WebMvcTest annotation

3.@DataJpaTest annotation

4.None of the above

Posted Date:-2024-01-29 15:53:27


Question:
Which interface represents the Spring IOC container?

1.ApplicationContent

2.ApplicationContentFactory

3.SessionFactory

4.DispatchServlet

Posted Date:-2024-01-29 16:07:37


Question:
Which is the default HTML template in Spring Boot

1.JSP

2.Freemarker

3.Thymeleaf

4.Groovy

Posted Date:-2024-01-29 15:03:51


Question:
Which is the default implementation class of the JpaRepository interface?

1.SimpleJpaRepository class

2.JpaRepositoryImpl class

3.CustomJpaRepository class

4.DefaultJpaRepository class

Posted Date:-2024-01-29 15:03:29


Question:
Which is the front controller in Spring MVC?

1.DispatcherServlet

2.FrontDispatcherServlet

3.FrontControllerService

4.None of the above

Posted Date:-2024-01-29 16:00:18


Question:
Which Spring annotation is used to create RESTful web services using Spring MVC?

1.@RestController

2.@Controller

3.@Component

4.@Rest

Posted Date:-2024-01-29 14:55:48


Question:
Which Spring annotation is used to extract the URI template variable value?

1.@PathVariable

2.@ParamRequest

3.@ModelAttribute

4.@RequestMapping

Posted Date:-2024-01-29 16:07:09


Question:
Which Spring annotation is used to handle HTTP DELETE requests?

1.@GetMapping

2.@PutMapping

3.@DeleteMapping

4.@PostMapping

Posted Date:-2024-01-29 15:02:04


Question:
Which Spring annotation is used to handle HTTP GET requests?

1.@GetMapping

2.@PutMapping

3.@CreateMapping

4.@PostMapping

Posted Date:-2024-01-29 15:01:36


Question:
Which Spring annotation is used to handle HTTP PUT requests?

1.@GetMapping

2.@PutMapping

3.@DeleteMapping

4.@PostMapping

Posted Date:-2024-01-29 15:02:31


Question:
Which Spring annotation is used to inject the Spring bean?

1.@Bean

2.@Autowired

3.@Service

4.@Inject

Posted Date:-2024-01-29 16:06:49


Question:
Which Spring Boot annotation is used to unit test the Spring Data JPA repository?

1.@SpringBootTest annotation

2.@WebMvcTest annotation

3.@DataJpaTest annotation

4.None of the above

Posted Date:-2024-01-29 15:54:24


Question:
Which Spring Framework module is used to implement cross-cutting concerns in Spring based-applications?

1.ORM

2.AOP

3.JDBC

4.TXM

Posted Date:-2024-01-29 16:02:49


Question:
Which starter dependency is used to develop web applications or Restful web services?

1.spring-boot-starter-data-jpa

2.spring-boot-starter-web

3.spring-boot-starter-rest

4.spring-boot-starter-web-dependency

Posted Date:-2024-01-29 15:50:02


More MCQS

  1. Spring Boot Common Test
  2. Spring Boot - Bootstrapping
  3. Spring Boot - Logging
  4. Spring Boot - Application Properties
  5. Spring Boot - RESTful Web Services
  6. Spring Boot - Exception Handling
  7. Spring Boot - Interceptor
  8. Spring Boot - File Handling
  9. Spring Boot - CORS
  10. Spring Boot - Internationalization
  11. Spring Boot - Scheduling
  12. Spring MCQs
  13. SPRING BOOT MCQ QUESTIONS
  14. Spring MVC MCQ QUESTIONS AND ANSWER
  15. Spring Cloud MCQ QUESTIONS AND ANSWER
  16. Spring WebFlux MCQ OUESTIONS AND ANSWER
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!